cmake_minimum_required(VERSION 2.8)

SET(PRJ_NAME 				fifo)

SET(PRJ_ROOTDIR				${CMAKE_CURRENT_SOURCE_DIR} )

PROJECT(${PRJ_NAME} 		C CXX)

MESSAGE(STATUS "Building POSIX FIFO samples routine.")

INCLUDE_DIRECTORIES( 
	"${PRJ_ROOTDIR}"
)

LINK_DIRECTORIES(
	"${PRJ_ROOTDIR}/build"
)
	
	SET(cflags	-std=gnu99)
	ADD_DEFINITIONS(${cflags})

	SET(SRCLIST_sample
		${PRJ_ROOTDIR}/sample1.c
	)

	ADD_LIBRARY(posixfifo SHARED ${PRJ_ROOTDIR}/posixfifo.c)

	ADD_EXECUTABLE(sample1  ${SRCLIST_sample} )
	TARGET_LINK_LIBRARIES(sample1  
	-ldl -lpthread -lposixfifo
	)
